package org.qtproject.qt5.android.bindings;

import android.content.Context;
import android.media.AudioManager;



/**
 * Created by Xiang on 2018/7/12.
 */

public class VolumeUtil {

	//音量调节管理者
	private static AudioManager am = (AudioManager) QtApplication.getContext().getSystemService(Context.AUDIO_SERVICE);
	public static void setStreamVolume (int index) {
		am.setStreamVolume(AudioManager.STREAM_MUSIC, index, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
	}
	//获取音量
	public static int getVolume(){
		return am.getStreamVolume(AudioManager.STREAM_MUSIC);
	}

}
